import os
from build_tools import * 

# get current dir path
cwd = PresentDir()

# init src and inc vars
src = []
inc = []

# add group to IDE project   
if IsDefined('ENABLE_LUA'):
    src = src + ['./luarun.c']
    inc = inc + [cwd]
objs = AddCodeGroup('lua-5.3.4', src, depend = ['ENABLE_LUA', 'OS_USING_SHELL'], CPPPATH = inc)

# traversal subscript
list = os.listdir(cwd)
if IsDefined('ENABLE_LUA'):
    for d in list:
        path = os.path.join(cwd, d)
        if os.path.isfile(os.path.join(path, 'SConscript')):
            objs = objs + SConscript(os.path.join(d, 'SConscript'))

Return('objs')
